package schema

import "fmt"

// 地理位置数据
const (
	GeographyTable = "Geography"
)

// Geography 表
type Geography struct {
	//ID             int64  `db:"Id,primarykey,autoincrement"`
	GeographyCode  string `db:"GeographyCode"`  //地理代码
	GeographyName  string `db:"GeographyName"`  //地理名称
	//Operator       string `db:"Operator"`       //收集器ID
	//InsertDatetime string `db:"InsertDatetime"` //插入时间
	//UpdateDatetime string `db:"UpdateDatetime"` //更新时间
	//Status         int    `db:"Status"`         //状态
	//Remark1        string `db:"remark1"`
	//Remark2        string `db:"remark2"`
	//Remark3        string `db:"remark3"`
	//Remark4        string `db:"remark4"`
}

// ReqData 省市县请求
type ReqData struct {
	AreaType      string
	GeographyCode string
}

// Validate 验证
func (p *ReqData) Validate() error {
	if p.AreaType == "" {
		return fmt.Errorf("没有传要请求省市县哪个")
	}
	return nil
}

func (p *ReqData) String() string {
	return jsonMarshal(p)
}
